package mamingliang.xbmu.lz;

import java.util.Scanner;

public class Main {

    public static void menu(){
        System.out.println("*****请选择要进行的操作*****");
        System.out.println("*****1.查看目录中文件");
        System.out.println("*****2.上传本地文件");
        System.out.println("*****3.删除hdfs文件");
        System.out.println("*****4.合并文件内容");
        System.out.println("*****5.查看文件内容");
        System.out.println("*****0.退出系统");
        System.out.println("*************************");
        System.out.println("*****请输入你的选项 (数字)");
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        FileOperation fileOperation = new FileOperation();

        menu();
        while (true) {
            int choose = scanner.nextInt();
            switch (choose) {
                case 0:
                    System.out.println("系统已退出！");
                    System.exit(0);
                    break;
                case 1:
                    fileOperation.showFiles();
                    menu();
                    break;
                case 2:
                    fileOperation.upload();
                    menu();
                    break;
                case 3:
                    fileOperation.delete();
                    menu();
                    break;
                case 4:
                    fileOperation.merge();
                    menu();
                    break;
                case 5:
                    fileOperation.showFileContent();
                    menu();
                    break;
                default:
                    System.out.println("*****请输入你的选项 (数字)");
                    break;
            }
        }
    }
}
